Assignemnt #62 and 60th program
Code
///Name: Derrick Andreasen
///Period: 7
///Program name: 60th Program
///File name: SixtProg.java
///Date Finished:11/13/2015
import java.util.Scanner;
import java.util.Random;
public class SixtProg
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
Random r = new Random();
System.out.println( "HERE COMES THE DICE!" );
System.out.println( "" );
int x = 1, c = 2, v;
while ( x != c )
{
x = 1 + r.nextInt(6);
c = 1 + r.nextInt(6);
System.out.println( "Roll #1: " + x );
System.out.println( "Roll #2: " + c );
v = x + c;
System.out.println( "The total is " + v + "!" );
System.out.println( "" );
}
}
}
Picture of the output